/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package rg1filedemo;

import java.io.File;

/**
 *
 * @author apple
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        File currentDir=new File(".");
        System.out.println(currentDir.getAbsolutePath());
        String[] files=currentDir.list();
        for(int i=0;i<files.length;i++)
        {
            File tempFile=new File(files[i]);
            if(tempFile.isFile())
            {
                System.out.println(files[i]+":"+tempFile.length());
            }
            if(tempFile.isDirectory())
            {
                System.out.println(files[i]+": <DIR>");
            }
        }
        FileHelper.writeFile("hello", "Hello World!\n How are you ?\n It is fun.\n");
        System.out.println(FileHelper.readFile("hello"));
    }
    
}
